

$(function () {
    PushLogin();
});

function PushLogin() {

    $("#loginbtn").click(function () {
        var data = $.requestInput('.inputval');
        //alert(JSON.stringify(data));
        $.postJSON('../../api/admin/auth/getoken',data,{},function (obj) {
            //$.postJSON(ADMIN_APPLICATIONS.get_web_route('/login/'),data,{},function (obj) {
                //reluesJsonfun(obj,ADMIN_APPLICATIONS.get_web_route('/adminusers'));

                if(obj.status === 200){
                    relues = obj.relues;
                    access_token = relues.access_token;
                    refresh_token = relues.refresh_token;
                    sessionStorage.setItem("access_token", access_token);
                    sessionStorage.setItem("refree_token", refresh_token)
                    window.location.href='/admin/Default';
                    return false
                }


                return false;
            });

    });

}